﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EBA.Logging
{
    /// <summary>
    /// 日志帮助
    /// </summary>
    public static class LoggingHelper
    {
        /// <summary>
        /// 将string转成Log等级
        /// </summary>
        /// <param name="val"></param>
        /// <returns></returns>
        public static LogLevel ConvertToLogLevel(string val)
        {
            switch (val)
            {
                case "Trace":
                    return LogLevel.Trace;
                case "Debug":
                    return LogLevel.Debug;
                case "Info":
                    return LogLevel.Info;
                case "Warn":
                    return LogLevel.Warn;
                case "Error":
                    return LogLevel.Error;
                case "Fatal":
                    return LogLevel.Fatal;
                case "Activty":
                    return LogLevel.Activty;

                default:
                    return LogLevel.Info;
            }
        }
    }
}
